package com.blog.cloud.api.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * 实体表基类
 *
 * @author 龙茶清欢
 * @since 2022-11-08 21:55:06
 */
@Getter
@Setter
public class BaseEntity {

    @Schema(description = "逻辑删除(0-正常 1-删除)")
    @TableLogic
    private Integer deleted;

    @JsonFormat
    @Schema(description = "创建时间")
    @TableField(value = "create_time" , fill = FieldFill.INSERT)
    private Date createTime;

    @JsonFormat
    @Schema(description = "更新时间")
    @TableField(value = "update_time" , fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Schema(description = "创建人")
    @TableField(value = "create_by")
    private String createBy;

    @Schema(description = "更新人")
    @TableField(value = "update_by")
    private String updateBy;

}
